Consulta
try
{

    inicializar( );
    ArrayList<UsuarioDTO> usuarios = new ArrayList<UsuarioDTO>( );
    String consulta =   "SELECT idUsuarios," + 
                        "email," + 
                        "password," +
                        "lastLogin" + 
                        " "+
                        "FROM usuarios"+
                        " "+
                        "WHERE email = ?"
                        +
                        " "
                        +
                        "AND"
                        +
                        " "
                        +
                        "password = ? ;"
                        ;

    PreparedStatement stmt = connect.prepareStatement( consulta );
    
    stmt.setString( 1,  email );
    
    stmt.setString( 2,  password );
    
    if( stmt != null )
    {
        resultSet = stmt.executeQuery( );

        while( resultSet.next( ) )
        {
            UsuarioDTO usuario = new UsuarioDTO( );

            Long prmlongUsuario = resultSet.getLong( "idUsuarios" );
            if( prmlongUsuario != null )
                usuario.setIdUsuario( prmlongUsuario );

            if( resultSet.getString( "email" ) != null )
            {
                String prmEmail = resultSet.getString( "email" );
                usuario.setEmail( prmEmail );
            }

            if( resultSet.getString( "password" ) != null )
            {
                String prmPassword = resultSet.getString( "password" );
                usuario.setPassword( prmPassword );
            }

            if( resultSet.getString( "lastLogin" ) != null )
            {
                String prmLastLogin = resultSet.getString( "lastLogin" );
                usuario.setLastLogin( prmLastLogin );
            }

            usuarios.add( usuario );
        }
    }
    closeConnection( );

    return usuarios;
}
catch( Exception e )
{
    throw new DatosException( e.getMessage( ) );
}

        
        
insertar


try
        {

            inicializar( );

            connect.setAutoCommit( false );

            String consulta =   "INSERT INTO Usuario" + 
                                "(" + 
                                "email," + 
                                "password," +
                                "lastLogin" + 
                                " "+
                                ")" +
                                "VALUES(?,?,?) ";

            String consulta2 = "SELECT last_insert_id() as prmInsertId; ";

            PreparedStatement stmt = connect.prepareStatement( consulta );

            PreparedStatement stmt2 = connect.prepareStatement( consulta2 );

            stmt.setString( 1, email );
            stmt.setString( 2, password );
            stmt.setString( 3, lastLogin );

            long prmLongIdTransaccion = 0;
            if( stmt != null )
            {
                stmt.execute( );
                resultSet = stmt2.executeQuery( );

                if( resultSet.next( ) )
                {
                    prmLongIdTransaccion = resultSet.getLong( "prmInsertId" );
                }

            }

            connect.commit( );

            return prmLongIdTransaccion;
        }
        catch( Exception e )
        {
            try
            {
                connect.rollback( );
            }
            catch( SQLException e1 )
            {
                e1.printStackTrace( );
            }
            e.printStackTrace( );
            throw new DatosException( e.getMessage( ) );
        }
        finally
        {
            closeConnection( );
        }
        
update

 try
        {
            inicializar( );
            connect.setAutoCommit( false );

            String consulta =   "UPDATE usuarios" + 
                                " " + 
                                "SET email = ? " + 
                                "WHERE idUsuarios = ? ;";

            PreparedStatement stmt = connect.prepareStatement( consulta );

            stmt.setString( 1, email );

            stmt.setLong( 2, idUsuario );
            
            if( stmt != null )
            {
                stmt.execute( );
            }

            connect.commit( );

        }
        catch( Exception e )
        {
            try
            {
                connect.rollback( );
            }
            catch( SQLException e1 )
            {
                e1.printStackTrace( );
            }
            e.printStackTrace( );
            throw new DatosException( e.getMessage( ) );
        }
        finally
        {
            closeConnection( );
        }
        
        